﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.InterferenceVolumeQuery.IVQTreeItem
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.ObjectModel;
using System.Windows.Media;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.InterferenceVolumeQuery;

public class IVQTreeItem : IIVQTreeViewItem
{
  private readonly ObservableCollection<IIVQTreeViewItem> _children = new ObservableCollection<IIVQTreeViewItem>();

  public IVQTreeItem()
  {
  }

  public IVQTreeItem(
    string name,
    string time,
    string note,
    string comment,
    ITxObject obj,
    ObservableCollection<IIVQTreeViewItem> childrenItems,
    ImageSource img)
  {
    this.IVQName = name;
    this.IVQLocationTime = time;
    this.IVQLocationNote = note;
    this.IVQLocationOLPComment = comment;
    this.IVQObject = obj;
    this.IVQObjectIcon = img;
    if (childrenItems == null)
      this._children = new ObservableCollection<IIVQTreeViewItem>();
    else
      this._children = childrenItems;
  }

  public string IVQLocationTime { get; set; }

  public string IVQLocationNote { get; set; }

  public string IVQLocationOLPComment { get; set; }

  public string IVQName { get; set; }

  public ImageSource IVQObjectIcon { get; set; }

  public ITxObject IVQObject { get; set; }

  public ObservableCollection<IIVQTreeViewItem> Children => this._children;

  public override bool Equals(object obj)
  {
    IIVQTreeViewItem ivqTreeViewItem = obj as IIVQTreeViewItem;
    ITxObject itxObject = obj as ITxObject;
    if (ivqTreeViewItem != null)
      return ivqTreeViewItem.IVQObject.Id.Equals(this.IVQObject.Id);
    return itxObject != null && itxObject.Id.Equals(this.IVQObject.Id);
  }
}
